﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StuManagementSystem
{
    public partial class frm_StuIndex : Form
    {
        /// <summary>
        /// 是否关闭变量
        /// </summary>
        public bool isClose = true;
        private int Stucode;
        public frm_StuIndex()
        {
            InitializeComponent();
        }
        public frm_StuIndex(int Code)
        {
            InitializeComponent();
            this.Stucode = Code;
        }

        private void frm_StuIndex_Load(object sender, EventArgs e)
        {

        }
        #region 账户管理
        /// <summary>
        /// 用户更改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void mns_AccountChange_Click(object sender, EventArgs e)
        {
            this.Owner.Show();
            isClose = false;
            this.Close();
        }
       
        #endregion

        #region 退出
        /// <summary>
        /// 程序退出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_Exit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        
        #endregion

        #region 关闭窗体
        /// <summary>
        /// 关闭窗口
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frm_Index_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (isClose == true)
                Application.Exit();
        }
        #endregion

        /// <summary>
        /// 更改密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mns_ChangePwd_Click(object sender, EventArgs e)
        {
            frm_ChangePwd frm = new frm_ChangePwd(Stucode,"Stu");
            frm.MdiParent = this;
            frm.Show();
        }
        /// <summary>
        /// 查看学生信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsr_ShowStuInfo_Click(object sender, EventArgs e)
        {
            frm_Myself frm = new frm_Myself(Stucode);
            frm.MdiParent = this;
            frm.Show();
        }

        /// <summary>
        /// 查看成绩
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsr_ShowStuMark_Click(object sender, EventArgs e)
        {
            frm_Result frm = new frm_Result(Stucode);
            frm.MdiParent = this;
            frm.Show();
        }



    }
}
